<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>考试管理系统</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="layuiadmin/style/admin.css?v=1" media="all">
  <script src="js/jquery.js"></script>
  <script src="js/axios.js"></script>
</head>
<body class="layui-layout-body">
  <div id="LAY_app">
    <div class="layui-layout layui-layout-admin">
      <div class="layui-header">
        <!-- 头部区域 -->
        <ul class="layui-nav layui-layout-left">
          <li class="layui-nav-item layadmin-flexible" lay-unselect>
            <a href="javascript:;" layadmin-event="flexible" title="侧边伸缩">
              <i class="layui-icon layui-icon-shrink-right" id="LAY_app_flexible"></i>
            </a>
          </li>
          
          <li class="layui-nav-item" lay-unselect>
            <a href="javascript:;" layadmin-event="refresh" title="刷新">
              <i class="layui-icon layui-icon-refresh-3"></i>
            </a>
          </li>
          
        </ul>
        <ul class="layui-nav layui-layout-right" lay-filter="layadmin-layout-right">
          <li class="layui-nav-item" lay-unselect>
            <a href="javascript:;">
              <cite th:text="${session.me.name}"></cite>
            </a>
            <dl class="layui-nav-child">
              <dd><a lay-href="rooter?url=system/user/password">修改密码</a></dd>
              <hr>
              <dd layadmin-event="logout" style="text-align: center;"><a>退出</a></dd>
            </dl>
          </li>
          
          <li class="layui-nav-item layui-hide-xs" lay-unselect>
            <a href="javascript:;"><i class="layui-icon layui-icon-more-vertical"></i></a>
          </li> 
        </ul>
      </div>
      
      <!-- 侧边菜单 -->
      <div class="layui-side layui-side-menu">
        <div class="layui-side-scroll">
          <div class="layui-logo" style="text-align: center;background-color: #FFF !important;" lay-href="home/console.html">
              <img src="images/logo.jpg" alt="logo">
           <div style="color: #fff;font-family: 华文彩云;font-size: 19px">首页</div>
          </div>
          <ul style="margin-top: 60px" class="layui-nav layui-nav-tree" lay-shrink="all" id="LAY-system-side-menu" lay-filter="layadmin-system-side-menu">
          </ul>
        </div>
      </div>

      <!-- 页面标签 -->
      <div class="layadmin-pagetabs" id="LAY_app_tabs">
        <div class="layui-icon layadmin-tabs-control layui-icon-prev" layadmin-event="leftPage"></div>
        <div class="layui-icon layadmin-tabs-control layui-icon-next" layadmin-event="rightPage"></div>
        <div class="layui-icon layadmin-tabs-control layui-icon-down">
          <ul class="layui-nav layadmin-tabs-select" lay-filter="layadmin-pagetabs-nav">
            <li class="layui-nav-item" lay-unselect>
              <a href="javascript:;"></a>
              <dl class="layui-nav-child layui-anim-fadein">
                <dd layadmin-event="closeThisTabs"><a href="javascript:;">关闭当前标签页</a></dd>
                <dd layadmin-event="closeOtherTabs"><a href="javascript:;">关闭其它标签页</a></dd>
                <dd layadmin-event="closeAllTabs"><a href="javascript:;">关闭全部标签页</a></dd>
              </dl>
            </li>
          </ul>
        </div>
        <div class="layui-tab" lay-unauto lay-allowClose="true" lay-filter="layadmin-layout-tabs">
          <ul class="layui-tab-title" id="LAY_app_tabsheader">
            <li lay-id="home/console.html" lay-attr="home/console.html" class="layui-this"><i class="layui-icon layui-icon-home"></i></li>
          </ul>
        </div>
      </div>
      
      
      <!-- 主体内容 -->
      <div class="layui-body" id="LAY_app_body">
        <div class="layadmin-tabsbody-item layui-show">
          <iframe src="console" frameborder="0" class="layadmin-iframe"></iframe>
        </div>
      </div>
      
      <!-- 辅助元素，一般用于移动设备下遮罩 -->
      <div class="layadmin-body-shade" layadmin-event="shade"></div>
    </div>
  </div>

  <script src="layuiadmin/layui/layui.js"></script>
  <script type="text/html" id="leftMenuTpl">
      {{# 
        var dataName = layui.setter.response.dataName ? layui.setter.response.dataName : 'data';
        layui.each(d[dataName], function(index,item){ 
      }}
          <li data-name="{{ item.name || '' }}" class="layui-nav-item {{ item.spread ? typeof item.list === 'object' && item.list.length > 0 ? 'layui-nav-itemed' : 'layui-this': '' }}" myDir = "1">
              {{# if(item.url){ }}
                  <a data-name="{{ item.name || '' }}" lay-href="{{ item.url }}" id="{{item.name}}" lay-tips="{{ item.title }}" lay-direction="2">
              {{# }else{ }}
                  <a href="javascript:;" id="{{item.name}}" lay-tips="{{ item.title }}" lay-direction="2">
              {{# } }}
                  {{# if(item.icon){ }}
                    <i class="layui-icon {{ item.icon }}"></i>
                    <cite>{{ item.title }}</cite>
                  {{# } }}
                 
              </a>
              {{#
                var itemListFun = function(itemList, myDir){
                  myDir = myDir || 2;
                  if(typeof itemList === 'object' && itemList.length > 0){ }}
                <dl class="layui-nav-child">
                    {{# layui.each(itemList, function(index2, item2){ }}
                        <dd style="{{# if(item2.state==7){}}display:none{{# }}}" data-name="{{ item2.name || '' }}" class="{{ item2.spread ? (typeof item2.list === 'object' && item2.list.length > 0 ? 'layui-nav-itemed' : 'layui-this' ) : ''}}" myDir="{{ myDir }}">
                            {{# if(item2.icon){ }}
                            {{# } }}
                            {{# if(item2.url){ }}
                            <a data-name="{{ item2.name || '' }}" id="{{item2.name}}" lay-href="{{ item2.url }}">
                  {{# if(item.icon){ }}
                    <i style='margin-left:20px' class="layui-icon {{ item2.icon }}"></i>
                  {{# } }}
                <cite style="margin-left:15px">{{ item2.title }}</cite>
                
                </a>
                            {{# }else{ }}
                            <a href="javascript:;">{{ item2.title }}</a>
                            {{# } }}
                            {{# itemListFun(item2.list,myDir+1);}}
                        </dd>
                    {{# }) }}
                </dl>
              {{#  } }}
            {{#  };
            itemListFun(item.list); }}
          </li>
      {{# }) }}
  </script>
  <script th:inline="javascript">
/*<![CDATA[*/
var meId=/*[[${session.me.id}]]*/     
//var topOrgId=/*[[${topOrgId}]]*/     
/*]]>*/
</script>
<script src="js/encrypt.js"></script>
<script src="js/getSign.js"></script>
  <script>
  layui.config({
    base: 'layuiadmin/' 
  }).extend({
    index: 'lib/index' 
  }).use(['index','laytpl','element'],function(){
	 var laytpl = layui.laytpl,id = 'LAY-system-side-menu',
	 element = layui.element,
     getTpl = document.getElementById('leftMenuTpl').innerHTML
     ,view = document.getElementById(id);
     var url = "navi/getLeftNaviList"
     $.ajax({
	     url: url
	     ,type:'POST'
	     ,dataType:'json'
	     ,success:function(res){
	          laytpl(getTpl).render(res,function(html){
	              view.innerHTML = "<li data-name=\"46\" class=\"layui-nav-item layui-this\" mydir=\"1\">  <a data-name=\"46\" lay-href=\"home/console.html\" id=\"46\" lay-tips=\"首页\" lay-direction=\"2\">   <i class=\"layui-icon layui-icon-home\"></i> <cite>首页</cite>  </a>   </li>"+html;
	              layui.element.render();
	          });
	          // setTimeout(function(){
	        	//   $(".layui-nav-tree li:eq(0)>a").click();
	        	//   $(".layui-nav-tree li:eq(0)").click().find("dl:eq(0)>dd:eq(0)>a").click();
	          // },100)
	          //
	      }
	 });

     window.addTab=function (id,name){
     	
     	element.tabAdd('layadmin-layout-tabs', {
     		  title: '<span>'+ name +'</span>'
     		  ,id: id
     		 ,attr: 'rooter?url=ksxt/lib/lib-list&naviid=15'
     		});    
     }
  });
  var height = document.documentElement.clientHeight - 105;
  var width = document.documentElement.clientWidth;
  function showNavi(url){
     // $(".layui-nav-tree li:eq(0)>a").click();
      $(".layui-nav-tree li").removeClass("layui-nav-itemed");
      $(`.layui-nav-tree li:has(a[lay-href*=${url}])`).addClass('layui-nav-itemed').find(`a[lay-href*=${url}]`).click();

     // $(`.layui-nav-tree dd a[lay-href*=${url}]`).trigger();
  }
  
  </script>

</body>
</html>


